import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/case_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class CaseListEntity {
  int? total;
  List<CaseInfo>? apply;
  List<CaseInfo>? settle;
  List<CaseInfo>? complete;
  List<CaseInfo>? conflict;

  CaseListEntity();

  factory CaseListEntity.fromJson(Map<String, dynamic> json) =>
      $CaseListEntityFromJson(json);

  Map<String, dynamic> toJson() => $CaseListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CaseInfo {
  String? id;
  String? createdAtStr;
  late String name = '';
  String? caseNameStr;
  String? caseName;
  String? caseTypeStr;
  String? caseStatus;
  late String caseDate = '';
  String? takerStr;
  String? suitType;
  String? lawsuitType;
  CaseInfoCiCo? cico;
  String? clientName;
  String? clientCode;
  String? oppositeName;
  String? oppositeCode;
  String? thirdName;
  String? thirdCode;
  String? archive;

  bool? isSignedContract;

  CaseInfo();

  factory CaseInfo.fromJson(Map<String, dynamic> json) =>
      $CaseInfoFromJson(json);

  Map<String, dynamic> toJson() => $CaseInfoToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CaseInfoCiCo {
  int? cStatus;
  int? oStatus;
  int? iStatus;

  CaseInfoCiCo();

  factory CaseInfoCiCo.fromJson(Map<String, dynamic> json) =>
      $CaseInfoCiCoFromJson(json);

  Map<String, dynamic> toJson() => $CaseInfoCiCoToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
